﻿namespace QYWXUpdate.DataModel.QYWXDocument
{
    /// <summary>
    /// 使用api插入智能表格数据请求体
    /// </summary>
    public class InsertDocumentRequest<T>
    {
        /// <summary>
        /// 文档id
        /// </summary>
        public string docid { get; set; }
        /// <summary>
        /// 子表id
        /// </summary>
        public string sheet_id { get; set; }
        public string key_type { get; set; }
        /// <summary>
        /// 记录
        /// </summary>
        public List<InsertDocumentRecords<T>> records { get; set; }
    }

    public class InsertDocumentRecords<T>
    {
        public T values { get; set; }
    }

    /// <summary>
    /// 使用api更新智能表格数据请求体
    /// </summary>
    public class UpdateDocumentRequest<T>
    {
        /// <summary>
        /// 文档id
        /// </summary>
        public string docid { get; set; }
        /// <summary>
        /// 子表id
        /// </summary>
        public string sheet_id { get; set; }
        public string key_type { get; set; }
        /// <summary>
        /// 记录
        /// </summary>
        public List<UpdateDocumentRecords<T>> records { get; set; }
    }

    public class UpdateDocumentRecords<T>
    {
        public string record_id { get; set; }
        public T values { get; set; }
    }

    public class InsertDocumentCommonTextType
    {
        public string type { get; set; }
        public string text { get; set; }
    }

    public class InsertDocumentCommonUserType
    {
        public string user_id { get; set; }
    }

    public class InsertDocumentCommonSelectType
    {
        public string type { get; set; }
        public string id { get; set; }
    }
}
